package com.ttyec.park;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;

import com.ttyec.park.common.SharedPreferencesHelper;
import com.ttyec.park.fragments.BaseSetFragment;

public class SetUrlActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_set_url);
        SharedPreferencesHelper helper = new SharedPreferencesHelper(this);
        String wsUrl = (String) helper.getSharedPreference(Utils.SP_WS_URL, "");
        if (!TextUtils.isEmpty(wsUrl)) {
            startActivity(new Intent(SetUrlActivity.this, homeActivity.class));
            finish();
        } else {
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new BaseSetFragment()).commit();
        }
    }
}
